package com.iqiyi.controller;

import com.iqiyi.domain.Region;
import com.iqiyi.service.RegionService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @auther Z_zjl
 * @date 2022/12/18 19:47
 * @Description
 */
@RestController
@RequestMapping("region")
@CrossOrigin(value = "http://localhost:8080")
public class RegionController {
    @Resource
    private RegionService regionService;

    /**
     * 查询出所有的区域
     * @return
     */
    @GetMapping("/findAll")
    private List<Region> findAll(){
        List<Region> regions = regionService.list();
        return regions;
    }
}
